<%@ Control Language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.Modules.SearchResults.SearchResults" CodeFile="SearchResults.ascx.vb" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
<style type="text/css">
	.highlight { background: #FFFF40; }
	.searchheading { font-size: 130%; font-weight: bold; }
	.summary { font-size: 80%; font-style: italic; }
	.suggestion { font-size: 100%; }
	.results { font-size: 100%; }
	.category { color: #999999; }
	.sorting { text-align: right; }

	.result_title { font-size: 100%; }		
	.description { font-size: 100%; color: #008000; }
	.context { font-size: 100%; }
	.infoline { font-size: 80%; font-style: normal; color: #808080;}

	.zoom_searchform { font-size: 100%; }
	.zoom_results_per_page { font-size: 80%; margin-left: 10px; }
	.zoom_match { font-size: 80%; margin-left: 10px;}				
	.zoom_categories { font-size: 80%; }
	.zoom_categories ul { display: inline; margin: 0px; padding: 0px;}
	.zoom_categories li { display: inline; margin-left: 15px; list-style-type: none; }
	
	input.zoom_button {  }
	input.zoom_searchbox {  }		
	
	.result_image { float: left; display: block; }
	.result_image img { margin: 10px; width: 80px; border: 0px; }

	.result_block { margin-top: 15px; margin-bottom: 15px; clear: left; }
	.result_altblock { margin-top: 15px; margin-bottom: 15px; clear: left; }
	
	.result_pages { font-size: 100%; }
	.result_pagescount { font-size: 100%; }
	
	.searchtime { font-size: 80%; }
	
	.recommended 
	{ 
		background: #DFFFBF; 
		border-top: 1px dotted #808080; 
		border-bottom: 1px dotted #808080; 
		margin-top: 15px; 
		margin-bottom: 15px; 
	}
	.recommended_heading { float: right; font-weight: bold; }
	.recommend_block { margin-top: 15px; margin-bottom: 15px; clear: left; }		
	.recommend_title { font-size: 100%; }
	.recommend_description { font-size: 100%; color: #008000; }
	.recommend_infoline { font-size: 80%; font-style: normal; color: #808080;}
</style>
<div style="padding-left:10px;padding-right:10px;padding-top:15px;padding-bottom:15px;">
	<h3 class="mainhead">Search this site</h3>
	<p>
	Enter one or more keywords to search for using the Search Engine.<br>
	Note that '*' and '?' wildcards are supported.
	</p>
	
	<span>Search for:</span>
	<asp:textbox id="txtSearch" runat="server" Wrap="False" maxlength="200" />	
	<asp:Button id="cmdGo" runat="server" cssclass="go" />
	
	<span class="zoom_results_per_page">Results per page:</span>
	<asp:DropDownList id="cboPaging" AutoPostBack="True" runat="server" >
		<asp:ListItem Value="10">10</asp:ListItem>
		<asp:ListItem Value="20">20</asp:ListItem>
		<asp:ListItem Value="50">50</asp:ListItem>
		<asp:ListItem Value="100">100</asp:ListItem>
	</asp:DropDownList>
	<br><br>
	
	<span class="zoom_match">
		Match:
        <asp:RadioButton GroupName="searchType" ID="searchAnyWords" runat="server" Text="any search words" Checked="true" />
        <asp:RadioButton GroupName="searchType" ID="searchAllWords" runat="server" Text="all search words" />		
	</span>
	<br><br>
	
	<asp:label ID="lblMessage" runat="server" cssClass="searchheading"/>
	<asp:Datagrid id="dgResults" runat="server" AutoGenerateColumns="False" AllowPaging="true" BorderStyle="None" ShowHeader="False" CellPadding="4" GridLines="None" PagerStyle-Visible="false">
		<Columns>
			<asp:TemplateColumn>
				<ItemTemplate>
					<b><asp:Label id="lblNo" runat="server" Text='<%# DataBinder.Eval(Container, "ItemIndex") + 1 %>' />.</b>
				</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn>
				<ItemTemplate>
					<asp:HyperLink id="lnkTitle" runat="server" CssClass="SubHead" NavigateUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,"TabId"),DataBinder.Eval(Container.DataItem,"Guid")) %>' Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'/>
					<asp:Label id="lblRelevance" runat="server" CssClass="Normal" Text='<%# FormatRelevance(DataBinder.Eval(Container.DataItem, "Relevance")) %>' Visible="False" />
					<br/>
					<div style="context">
						<asp:Label id="lblSummary" runat="server" CssClass="Normal" Text='<%# DataBinder.Eval(Container.DataItem, "Description") + "<br>" %>' Visible="<%# ShowDescription() %>" />
					</div>
					<div style="color:#808080;font-size:80%;font-style:normal;">
						URL:&nbsp;<asp:HyperLink id="lnkLink" runat="server" CssClass="CommandButton" NavigateUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,"TabId"),DataBinder.Eval(Container.DataItem,"Guid")) %>' Text='<%# FormatURL(DataBinder.Eval(Container.DataItem,"TabId"),DataBinder.Eval(Container.DataItem,"Guid")) %>'/>
						<asp:Label id="lblPubDate" runat="server" CssClass="Normal" Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, "PubDate")) %>' Visible="False"/>
					</div>
				</ItemTemplate>
			</asp:TemplateColumn>
		</Columns>
	</asp:Datagrid>
	<br/><br/>
	<dnn:pagingcontrol id=ctlPagingControl runat="server" Mode="PostBack"/>
</div>
<script>
	$("input[id$=SearchInput_txtSearch]").focus(function(e) {
		if ($(this).val() == 'Search the Site') {
			$(this).val('');
		}
	});
	$("input[id$=SearchInput_txtSearch]").keydown(function(e) {
		if(e.which == '13' || e.keyCode == '13') {
			$(this).next('input.go').click();			
			return false;
		}
	});
</script>
